<?php TPL::output('admin/global/header.tpl.htm'); ?>
<?php TPL::output('admin/global/nav_menu.tpl.htm'); ?>

<div class="aw-content-wrap" id="user_list">
    <div class="mod">
        <div class="mod-head">
            <h3>
                <ul class="nav nav-tabs">
                    <li<?php if (!$_GET['type']) { ?> class="active"<?php } ?>><a href="<?php if ($_GET['type']) { ?>admin/goods/special/<?php } else { ?>#list<?php } ?>"<?php if (!$_GET['type']) { ?> data-toggle="tab"<?php } ?>><?php _e('专题列表'); ?></a></li>
                    <li<?php if ($_GET['type'] == 'forbidden') { ?> class="active"<?php } ?>><a href="<?php if ($_GET['type'] == 'forbidden') { ?>#list<?php } else { ?>admin/goods/special/type-forbidden<?php } ?>"<?php if ($_GET['type'] == 'forbidden') { ?> data-toggle="tab"<?php } ?>><?php _e('下线专题'); ?></a></li>
                    <li><a href="#search" data-toggle="tab"><?php _e('搜索'); ?></a></li>
                    <li><a href="admin/goods/special_add/"><?php _e('添加专题'); ?></a></li>
                </ul>
            </h3>
        </div>
        <div class="mod-body tab-content">
            <div class="tab-pane active" id="list">
                <?php if ($_GET['action'] == 'search') { ?>
                <div class="alert alert-info"><?php _e('找到 %s 条符合条件的内容', intval($this->total_rows)); ?></div>
                <?php } ?>

                <div class="table-responsive">
                <?php if ($this->list) { ?>
                    <form method="post" action="admin/ajax/remove_goods/" id="users_form">
                    <table class="table table-striped">
                        <thead>
                            <tr>
                                <th><input type="checkbox" class="check-all"></th>
                                <th>ID</th>
                                <th><?php _e('标题'); ?></th>
                                <th><?php _e('状态'); ?></th>
                                <th><?php _e('创建时间'); ?></th>
                                <th><?php _e('最后更新时间'); ?></th>
                                <th><?php _e('操作'); ?></th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php foreach ($this->list AS $key => $val) { ?>
                            <tr>
                                <td><input type="checkbox" value="<?php echo $val['goods_id']; ?>" name="goods_id[]"></td>
                                <td><?php echo $val['id']; ?></td>
                                <td><?php echo $val['title']; ?></td>
                                <td><?php if($val['state']==0){echo '下线';}else{ echo '上线';} ?></td>
                                <td><?php echo date_friendly($val['add_time']); ?></td>
                                <td><?php echo date_friendly($val['update_time']); ?></td>
                                <td class="nowrap">
                                    <a href="admin/goods/special_edit/id-<?php echo $val['id']; ?>" class="icon icon-edit md-tip" title="<?php _e('编辑'); ?>"></a>
                                    <!--<?php if (get_setting('integral_system_enabled') == 'Y') { ?><a href="admin/user/integral_log/uid-<?php echo $val['uid']; ?>" class="icon icon-signup md-tip" title="<?php _e('积分日志'); ?>"></a><?php } ?>-->
                                    <!--<?php if ($val['uid'] != $this->user_id) { ?><a href="javascript:;" onclick="AWS.ajax_request(G_BASE_URL + '/admin/ajax/forbidden_user/' , 'uid=<?php echo $val['uid']; ?>&status=<?php echo intval($val['forbidden']) ? 0 : 1; ?>');" title="<?php if ($val['forbidden']) { ?><?php _e('解除封禁'); ?><?php } else { ?><?php _e('封禁用户'); ?><?php } ?>" class="icon <?php if ($val['forbidden']) { ?>icon-plus<?php } else { ?>icon-forbid<?php } ?> md-tip"><?php } ?>-->
                                </td>
                            </tr>
                            <?php } ?>
                        </tbody>
                    </table>
                    </form>
                <?php } ?>
                </div>

                <div class="mod-table-foot">
                    <div class="col-sm-4 col-xs-12">
                        <a class="btn btn-danger" onclick="AWS.ajax_post($('#users_form'));"><?php _e('删除'); ?></a>
                    </div>
                    <div class="col-xs-12 col-sm-8">
                        <?php echo $this->pagination; ?>
                    </div>
                </div>
            </div>
            <!--搜索模板-->
            <?php TPL::output('admin/goods_special/search.tpl.htm'); ?>
        </div>
    </div>
</div>

<script type="text/javascript">
$(document).ready(function () {
    // $('.select_area').LocationSelect({
    //     labels: ["<?php _e('请选择省份或直辖市'); ?>", "<?php _e('请选择城市'); ?>"],
    //     elements: document.getElementsByTagName("select"),
    //     detector: function () {
    //         this.select(["<?php echo $_GET['province']; ?>", "<?php echo $_GET['city']; ?>"]);
    //     },
    //     dataUrl: G_BASE_URL.replace('/?', '') + '/static/js/areas.js'
    // });
});
</script>

<?php TPL::output('admin/global/footer.tpl.htm'); ?>